home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / System / MRAC / Lengths / Modify / l-rest-condense < prev    next >
Lisp/Scheme  |  1998-08-11  |  410b  |  17 lines

  1. l-rest-condense length-pattern
  2.  
  3. This function condenses a sequence of rests-lengths into the sum of its parts.
  4.  
  5. (setq len '(-1/20 -1/20 1/20 -1/20 -1/20))
  6.  
  7. (setq len1 (l-rest-condense len))
  8. => (-1/10 1/20 -1/10)
  9.  
  10. (l-rest-revert len)
  11. => (1/20 1/20 1/20 1/20 1/20)
  12.  
  13. (l-rest-revert len1)
  14. => (1/10 1/20 1/10)
  15.  
  16. (l-rest-condense '((-1/20 -1/20 1/20 -1/20 -1/20) (1/8 -1/16 -1/16)))
  17. => ((-1/10 1/20 -1/10) (1/8 -1/8))